fix: use heredoc for PROMPT to fix YAML block scalar indentation#16
Merged
fix: use heredoc for PROMPT to fix YAML block scalar indentation#16
Conversation
The multiline PROMPT string started at column 0, which caused the YAML parser to end the run block early (block scalar indentation level is determined by the first content line at 10 spaces). This broke YAML parsing entirely, causing the workflow name to display as the file path and the workflow to misfire on push events. Replace with a bash heredoc; all lines are now at 10-space YAML indentation so the block scalar is parsed correctly.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PR #15 introduced a YAML parsing error in
release.yml.The
PROMPT="..."multiline string assignment had its continuation lines (the prompt body text) at column 0, while the surroundingrun: |block uses 10-space indentation. YAML block scalars determine their indentation level from the first non-empty content line — when a non-empty line appears with less indentation than the block level, the YAML parser considers the block ended.Symptoms:
.github/workflows/release.ymlinstead ofRelease(GitHub falls back to file path when YAML fails to parse thename:field correctly)Fix
Replace the bare multiline string with a bash heredoc (
<<END_PROMPT). All lines are now properly indented at 10 spaces within the YAML block scalar, so the YAML parser sees the entirerun:block as valid.After YAML strips the 10-space indent, bash receives the heredoc with
END_PROMPTat column 0 (the correct terminator position) and the prompt content starting at column 0 as intended.